package ink.yuanchu.picachoframework.controller;

import ink.yuanchu.picachoframework.entity.Permissions;
import ink.yuanchu.picachoframework.message.ResultBody;
import ink.yuanchu.picachoframework.service.PermissionsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 权限控制层
 * @author ziyuan
 * @Date: 2021/03/18/15:53
 * @Description:
 */
@RestController
@RequestMapping("/picachoframework/backendPermissions")
@Api("权限控制类")
public class PermissionsController {

    @Autowired
    private PermissionsService permissionsService;

    /**
     * 根据permissionsId去重查询，返回结果
     * @return
     */
    @GetMapping("/getDistinctPermissions")
    @ApiOperation(value = "根据permissionsId去重查询，返回结果",notes = "")
    public ResultBody getDistinctPermissions(){
        List<Permissions> permissions = permissionsService.findAll();
        return ResultBody.success(permissions);
    }
}
